$(function(){
	medicalOrderDetail();
	
	function medicalOrderDetail(){
		orderid= utilModule.getQueryString("orderid");
		console.log(orderid);
		var param = {"id":orderid};
		function callBackSlider(data){
			console.log(data);
			var html='<i class="iconfont icon-023"></i>馨语医疗';
			if(data.shippingStatus==0){
				html+='<span class="color_orange">未发货</span>';
			}else if(data.shippingStatus==1){
				html+='<span class="color_orange">已发货</span>';
			}else if(data.shippingStatus==2){
				html+='<span class="color_orange">已收货</span>';
			}else if(data.shippingStatus==4){
				html+='<span class="color_orange">售后单</span>';
			}
			$(".logisticsName").append(html);
			
			var html2='<i class="iconfont icon-024"></i>'+data.consignee+'<span>'+data.mobile+'</span><p>地址：'+data.address+'</p>';
			$(".logisticsAdress").append(html2);
			
			var html3='';
			for(i in data.prescriptionDetailList){
				html3+='<li><div><img src="'+data.prescriptionDetailList[i].thumbnail+'"><span>'+data.prescriptionDetailList[i].name+'<p>*'+data.prescriptionDetailList[i].count+'</p></span><font>￥'+data.prescriptionDetailList[i].price+'</font></div></li>';
			}
			$(".drug-listContent ul").append(html3);
			
			var moneyAll=parseFloat(data.goodsAmount);
			moneyAll+=parseFloat(data.shippingFee);
			console.log(moneyAll.toFixed(2))
			$(".drug-listContent .postage span").text("￥"+data.shippingFee);
			$(".drug-listContent .all .zj").text("￥"+moneyAll.toFixed(2));
			$(".drug-listContent .all .xj").text("￥"+data.goodsAmount);
			//$(".drug-listContent .all span").text("￥"+data.goodsAmount);
			$(".drug-listContent .all font").text("-￥"+data.shippingFee);
			
			var html4='订单编号：'+data.ordersn +'<p>支付方式：微信支付</p><p>下单时间：'+data.addTime+'</p>';
			$(".logisticsOrder").append(html4);
			
			$("#seePrescription").attr("presId",data.prescriptionId);
		}
		onlineContinuationModule.getOneMallOrder(param,callBackSlider);
	}
	$("#seePrescription").on("click",function(){
		var id=$(this).attr("presId");
		location.href = "../../html/onlineContinuation/prescription-detail.html?id="+id;
	});
});